package com.visionet.waveletData.web.repository.group;

import com.visionet.waveletData.web.entity.group.Group;
import com.visionet.waveletData.web.vo.GroupVo;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * Created by hxpeng on 2017/1/12.
 */

@Repository
public interface GroupDao extends JpaRepository<Group,Long> {

    public PageImpl<GroupVo> findPageGroup(GroupVo groupVo, Pageable page);

    @Query(value = "from Group where group_name = ?1 and company_id = ?2 and is_deleted = 0 ")
    public Group findGroupByNameAndCompanyId(String groupName,String companyId);

}
